package com.example.springcloud.controller;


import com.example.springcloudapi.pojo.Dept;
import com.example.springcloudapi.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Controller
public class DeptConsumerController {


    @Autowired
    private DeptClientService service;



@ResponseBody
@GetMapping("/consumer/{id}")
public Dept get(@PathVariable("id") Long id){

    return this.service.queryById(id);

        }

@ResponseBody
@GetMapping("/consumer/dept/getAll")
public List getAll(){

    return this.service.queryAll();


        }

        }
